package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.DstUserArticleDTO;
import com.financing.wap.dao.IDstUserArticleDao;
import com.financing.wap.common.SqlName;
/**
 * dst_user_article  
 * 用户文章关联 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("dstUserArticleDao")
public class DstUserArticleDaoImpl extends BaseDaoImpl<DstUserArticleDTO, java.lang.Integer> implements IDstUserArticleDao {


	@Override
	public int insert(DstUserArticleDTO dstUserArticle) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.insert(SqlName.DstUserArticleSql.insert, dstUserArticle);
	}

	@Override
	public void update(DstUserArticleDTO dstUserArticle) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstUserArticleSql.update, dstUserArticle);
	}

	@Override
	public void updateForce(DstUserArticleDTO dstUserArticle) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.DstUserArticleSql.updateForce, dstUserArticle);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.DstUserArticleSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<DstUserArticleDTO> queryList(DstUserArticleDTO dstUserArticle) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.DstUserArticleSql.queryList, dstUserArticle);
	}

	@Override
	public int queryListCount(DstUserArticleDTO dstUserArticle) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.DstUserArticleSql.queryListCount, dstUserArticle);
	}

	@Override
	public DstUserArticleDTO loadById(Integer id) throws SQLException {
		return  (DstUserArticleDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.DstUserArticleSql.loadById,id);
	}

	@Override
	public Class<DstUserArticleDTO> getEntityClass() {
		return DstUserArticleDTO.class;
	}
 	
}
